<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
var re = new RegExp('a','i');
var str = 'Abcdef';

alert(str.search(re));
</script>
</head>

<body>
</body>
</html>
